package com.ebelter.myehc.ui.activitys;


import android.webkit.WebView;

import com.ebelter.myehc.R;

public class WebActivity extends EhcBaseActivity{

    public static final String DATA_FIRST_OPEN_URL = "data_firstOpenUrl";//传进来的第一个需要打开的网页地址

    private String data_firstOpenUrl;//传进来的第一个需要打开的网页地址

    WebView webView;
    @Override
    protected int loadLayoutById() {
        return R.layout.activity_web;
    }

    @Override
    protected void initView() {
        super.initView();
        webView=findViewById(R.id.webView);
    }


    @Override
    protected void initData() {
        super.initData();
        getDatas();
        webView.loadUrl(data_firstOpenUrl);
    }



    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (webView != null) {
            webView.stopLoading();
            webView.clearHistory();
            webView.clearCache(true);
            webView.loadUrl("about:blank");
            webView.pauseTimers();
            webView = null;
        }

    }

    //获取传进来的参数
    public void getDatas() {
        data_firstOpenUrl = getIntent().getStringExtra(DATA_FIRST_OPEN_URL);
    }
}
